Skip to content

feat: Fast upgrades: upgrade payload section in blocks - #11655

Merged
frankdavid merged 23 commits into
masterfrom
frankdavid/fast-upgrades-block-payload
Sep 25, 2026
Merged

frankdavid merged 23 commits into
masterfrom
frankdavid/fast-upgrades-block-payload

Conversation

@frankdavid

Copy link
Copy Markdown
Contributor

Add the upgrade section to block payloads and wire it into the payload builder infrastructure (with a placeholder builder for now).

  • Add upgrade_payload_bytes to the Block proto and upgrade to BatchPayload/BatchMessages
  • Add an Upgrade section to BatchPayloadSectionBuilder
  • Add the ic-consensus-upgrade crate with a placeholder UpgradePayloadBuilder

First step of the Phase-2 rolling-reboot consensus protocol, which adds the data types and the artifact mechanism.

* Add `UpgradePermitAction` (`Request` / `Authorize` / `Return`). `UpgradePermitAuthorizationRequest` is the signed content, `UpgradePermitAuthorizationShare` is the gossiped artifact.
* Add the in-memory `UpgradePermitAuthPoolImpl` which is modeled after other pools.
* Add the `ic-consensus-upgrade` crate with `UpgradePermitAuthPoolManager`. It signs shares for requests in finalized blocks and validates gossiped shares.
* Register the new proto file with the generator and add `UpgradePermitAuthorizationRequest` (signing) and `UpgradePermitAuthorizationShare` (pool-ID hashing) domain separators.
Add the upgrade section to block payloads and wire it into the payload builder infrastructure (with a placeholder builder for now).

- Add `upgrade_payload_bytes` to the `Block` proto and upgrade to `BatchPayload`/`BatchMessages`
- Add an `Upgrade` section to `BatchPayloadSectionBuilder`
- Add the `ic-consensus-upgrade` crate with a placeholder `UpgradePayloadBuilder`
@frankdavid
frankdavid added this pull request to stack #11656 September 22, 2026 20:20
@frankdavid
frankdavid requested a review from a team as a code owner September 22, 2026 20:20
@github-actions github-actions Bot added the feat label Sep 22, 2026
@zeropath-ai

zeropath-ai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to b242534.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/consensus/upgrade/BUILD.bazel
    Add upgrade module to Bazel build for consensus upgrade
► rs/consensus/upgrade/Cargo.toml
    Introduce ic-consensus-upgrade crate dependencies
► rs/consensus/upgrade/src/lib.rs
    Export payload_builder module
► rs/consensus/upgrade/src/payload_builder.rs
    Implement UpgradePayloadBuilder with build/validate stubs
► rs/interfaces/src/upgrade.rs
    Define InvalidUpgradePayloadReason enum
► rs/interfaces/src/lib.rs
    Expose upgrade module
Enhancement ► rs/consensus/src/consensus.rs
    Add upgrade_payload_builder parameter to ConsensusImpl constructor/signature
► rs/consensus/src/consensus/payload.rs
    Add Upgrade variant to BatchPayloadSectionBuilder and related logic
► rs/consensus/src/consensus/payload_builder.rs
    Integrate Upgrade payload builder into payload construction flow
► rs/consensus/tests/framework/runner.rs
    Pass upgrade_payload_builder through test framework
► rs/consensus/tests/framework/types.rs
    Include upgrade_payload_builder in Dependencies
Enhancement ► rs/consensus/tests/payload.rs
    Wire in upgrade_payload_builder for test consensus scenarios
► rs/replica/setup_ic_network/src/lib.rs
    Reference UpgradePayloadBuilderImpl in startup path
► rs/replica/setup_ic_network/BUILD.bazel
    Include upgrade in consensus-related targets
► rs/replica/setup_ic_network/Cargo.toml
    Add ic-consensus-upgrade as path dependency
Enhancement ► rs/state_machine_tests/BUILD.bazel
    Add consensus upgrade to test suite dependencies
► rs/state_machine_tests/Cargo.toml
    Add ic-consensus-upgrade as dependency
► rs/state_machine_tests/src/lib.rs
    Import UpgradePayloadBuilderImpl for tests
► rs/state_machine_tests/src/lib.rs
    Include upgrade_payload_builder in StateMachine construction
Enhancement ► rs/types/types/src/batch.rs
    Add upgrade field to BatchPayload struct
► rs/types/types/src/consensus.rs
    Include upgrade_payload_bytes in pb Block mapping
► rs/protobuf/def/types/v1/consensus.proto
    Add upgrade_payload_bytes field to Block message
► rs/protobuf/src/gen/types/types.v1.rs
    Add upgrade_payload_bytes field to generated Block struct
► rs/types/types/src/consensus.rs (From for pb::Block)
    Include upgrade payload in conversions
Enhancement ► rs/interfaces/src/consensus.rs
    Extend InvalidPayloadReason with InvalidUpgradePayload(InvalidUpgradePayloadReason)
Enhancement ► rs/protobuf/def/types/v1/consensus.proto
    Extend Block message with upgrade_payload_bytes field

@alin-at-dfinity alin-at-dfinity left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change overall LGTM, but I'll leave it to Leo or Pierugo to approve, particularly since I'm not sure what the changed hashes in the crypto_hash_stability tests imply.

Comment thread rs/protobuf/def/types/v1/consensus.proto Outdated
Comment thread rs/consensus/Cargo.toml Outdated
Comment thread rs/consensus/src/consensus/payload.rs
Comment thread rs/types/types/src/crypto/hash/tests.rs Outdated
Comment thread rs/consensus/src/consensus/payload_builder.rs Outdated
Comment thread rs/consensus/upgrade/src/payload_builder.rs Outdated
Comment thread rs/consensus/upgrade/src/payload_builder.rs Outdated
Comment thread rs/types/types/src/crypto/hash/tests.rs Outdated
@frankdavid
frankdavid removed this pull request from stack #11656 September 24, 2026 13:33
Base automatically changed from frankdavid/fast-upgrades-consensus1 to master September 24, 2026 14:41
Comment thread rs/consensus/src/consensus/payload_builder.rs Outdated
Comment thread rs/consensus/src/consensus/payload_builder.rs Outdated
@frankdavid
frankdavid added this pull request to the merge queue Sep 25, 2026
Merged via the queue into master with commit 6a69574 Sep 25, 2026
38 checks passed
@frankdavid
frankdavid deleted the frankdavid/fast-upgrades-block-payload branch September 25, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants